import {
  firstPerspective,
  moveToHere,
  openKeyboardRoaming,
  pointMarker,
  resetMap,
  showCoordinates,
  spaceArea,
  spaceDistance,
  viewChange
} from "./index.ts";
import { getMap } from "../../mapbox_core/mapInitialization/index.ts";
// menuConfig.ts
export interface MenuItem {
  label: string;
  icon?: string;
  action?: () => void;
  submenu?: MenuItem[];
  // 其他属性，比如是否启用，权限控制等
}

export const contextMenuConfig: MenuItem[] = [
  {
    label: "初始化地图",
    action: () => resetMap(getMap())
  },
  {
    label: "查看此处坐标",
    action: () => showCoordinates()
  },
  {
    label: "视角切换",
    submenu: [
      {
        label: "切换2.5维",
        action: () => viewChange(getMap(), "2.5D")
      },
      {
        label: "切换2维",
        action: () => viewChange(getMap(), "2D")
      },
      {
        label: "切换3维",
        action: () => viewChange(getMap(), "3D")
      }
    ]
  },
  {
    label: "视角控制",
    submenu: [
      {
        label: "移动到此处",
        action: () => moveToHere(getMap())
      },
      {
        label: "第一视角站在此处",
        action: () => firstPerspective(getMap())
      },
      {
        label: "开启键盘漫游",
        action: () => openKeyboardRoaming(getMap())
      }
    ]
  },
  {
    label: "图上量算",
    submenu: [
      {
        label: "空间测距",
        action: () => spaceDistance()
      },
      {
        label: "空间测面",
        action: () => spaceArea()
      }
    ]
  },
  {
    label: "图上标记",
    submenu: [
      {
        label: "标记点",
        action: () => pointMarker()
      }
      // {
      //     label: '标记线',
      //     action: () => viewChange(60)
      // },
      // {
      //     label: '标记面',
      //     action: () => viewChange(60)
      // },
      // {
      //     label: '标记圆',
      // },
      // {
      //     label: '标记矩形',
      //     action: () => viewChange(60)
      // }
    ]
  }
  // {
  //     label: '场景设置',
  //     submenu: [
  //         {
  //             label: '开启/关闭深度测试',
  //             action: () => viewChange(60)
  //         },
  //         {
  //             label: '开启/关闭星空背景',
  //             action: () => viewChange(60)
  //         },
  //         {
  //             label: '开启/关闭日照阴影',
  //             action: () => viewChange(60)
  //         },
  //         {
  //             label: '开启/关闭大气渲染',
  //             action: () => viewChange(60)
  //         },
  //         {
  //             label: '导出场景图',
  //             action: () => viewChange(60)
  //         }
  //     ]
  // }
];
